import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from '../views/home.vue'
import login from '../views/login.vue'
import result from '../views/result.vue'
import test from '../views/test.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/about',
    redirect: '/about/test/0',
    name: 'Home',
    component: Home,
    children: [
      {
        path: '/about/test/:id',
        name: 'test',
        component: test,
      },
      {
        path: '/about/result',
        name: 'result',
        component: result
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: login,
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
